# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=nampa
pkgname=python-${_pyname}
pkgver=1.0
pkgrel=3
pkgdesc='FLIRT signatures for python'
url='https://github.com/thebabush/nampa'
license=('LGPL3')
arch=('any')
depends=('python' 'python-future')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('899ee2786b0d1739f5d9836310e13c7fdc46df14259491acc480db69f291d6c9934d059064a54798fecab84a9e4a731ada71105dee67b967e93d3cb4435a3387')
b2sums=('73122bb669f825fd1b50f6fba1b58f0c1232c404590b7ada652e3142bd4bf74aae21dcb3362c6c9ec7bd1904e13bf1654c2eb3e8ec68332f1a92660bee2ac249')

build() {
  cd ${_pyname}-${pkgver}
  export EXTRA_CFLAGS="${CFLAGS} ${CPPFLAGS}"
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pyname}-${pkgver}
  PYTHONPATH=build/lib pytest
}

package() {
  cd ${_pyname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
